<?php
$adm_menu = "1";

include("config.php");
if (!isset($_SESSION["auser"]) || $_SESSION["auser"] == "" || $_SESSION['agroup'] != "WEB_ADMIN") header('Location: index.php');


$db_www = new DB($server_username,$server_pass,$server_db,$server,$driver);
$db_rdata = new DB($rdata_server_username,$rdata_server_pass,$rdata_server_db,$rdata_server,$rdata_driver);


	
include("header.php");
include("menu.php");



	if (isset($_REQUEST["code"]) && $_REQUEST["code"] != "0") {
		$code = $_REQUEST["code"];
		$uid = $code;		
		if (isset($_REQUEST["uid"])) {
			$sql = str_replace("<kodas>", addslashes_mssql($_REQUEST["uid"]), $uinfo_query);
		} else {
			$sql = str_replace("<kodas>", addslashes_mssql($uid), $uinfo_query);
		}
		
		$u = $db_www->returnInfo($sql);
		if ($u == null) die("nerastas vartotojas");
		$imcode = trim($u["n60_kodas_ks"]);	
	} else {
		die("nerastas vartotojas");
	}

		
		$tit = "Finansai";		
?>

<table class="innercont" cellspacing="0" cellpadding="10" border="0">
<tr><td class="leftcol2">


<?php
printUserEditMenu($_SESSION["page_ret"],$_REQUEST["code"],$u["n60_kodas_sm"],$u["n60_pareigos"]);
?>


</td><td class="rightcol" colspan="2">

<div class="title2" style="width:400px;"><?php echo $tit?></div>
<br>
<?php
printActiveDocumentsTable($imcode);
?>

<?php
printReceivedPaymentsTable($imcode);	
?>


</td></tr>
<tr><td>&nbsp;</td><td>

<Button id='unblockButton' class='but bgwhite nopad' onclick="window.location='<?php if ($_SESSION["page_ret"] == "users") echo "users.php"; else echo "acards.php?submit=Rodyti";?>';return false;">Atgal</Button>

<?php

?>
</td>
<td style="text-align:right;">

</td>
</tr>
</table>

<?php
include("footer.php");
?>